package com.sstir.doctor.common;

import org.apache.commons.lang3.StringUtils;

/**
 * @ClassName BusinessEnum
 * @Description
 * @Author hanjunjun
 * @Date 2021/1/15 11:41
 */
public enum DifficultyEnum {

    SYMPLE(1, "简单"),

    MIDDLE(2, "中等"),

    HARD(3, "困难");

    DifficultyEnum(int code, String label){
        this.setCode(code);
        this.setLabel(label);
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    private int code;

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    private String label;

    public static String getLabelByCode(int code){
        for (DifficultyEnum anEnum : DifficultyEnum.values()){
            if (code == anEnum.getCode()){
                return anEnum.getLabel();
            }
        }
        return StringUtils.EMPTY;
    }


}
